package edu.nctu.csie.jichang.dp.creational;

public class AbstractFactory {
	public static void main(String[] args) {
		new Form(new WinFactory());
		new Form(new UnixFactory());
	}
}
class Form{
	AbstractFactoryFactory factory;
	Form(AbstractFactoryFactory factory){
		this.factory = factory;
		initial();
	}
	private void initial() {
		System.out.println("inital " + factory.createButton());
		System.out.println("inital " + factory.createWindows()); 
	}
}
interface AbstractFactoryFactory{
	String createButton();
	String createWindows();
}
class WinFactory implements AbstractFactoryFactory{
	public String createButton()  { return "Win Button";}
	public String createWindows() { return "Win Windows";}
}
class UnixFactory implements AbstractFactoryFactory{
	public String createButton()  { return "Unix Button";}
	public String createWindows() { return "Unix Windows";}
}